<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>文档列表</title>
</head>
<body>
	<c:url value="/front/ListFile" var="url" />
	<form action="${url}" method="post">

		<table align="center">
			<caption>文档列表</caption>
			<tr>
				<th>名称</th>
				<th>时间</th>
				<td><a href="UploadDoc">上传</a></td>
			</tr>
			<c:forEach items="${paging.datas}" var="doc" varStatus="status">
				<tr>
					<td>${doc.name}</td>
					<td>${doc.uploadedTime}</td>
					<td>
					<a href="DelDoc?id=${doc.id}"
					   onClick="return confirm('确实要删除文档 ${doc.name}');">
					   删除
					</a>					
					</td>
				</tr>
			</c:forEach>
		</table>

		<table align="center">
			<tr>
				<c:if test="${paging.pageCount>1}">
					<td><input type="submit" value="首页" name="firstPage" /></td>
				</c:if>
				<c:if test="${paging.pageNo>0 && paging.pageNo<=paging.pageCount-1}">
					<td><input type="submit" value="前页" name="previousPage" /></td>
				</c:if>
				<td>第${paging.pageNo+1}页 / 共${paging.pageCount}页</td>
				<c:if test="${paging.pageNo>=0 && paging.pageNo<paging.pageCount-1}">
					<td><input type="submit" value="后页" name="nextPage" /></td>
				</c:if>
				<c:if test="${paging.pageCount>1}">
					<td><input type="submit" value="尾页" name="lastPage" /></td>
				</c:if>
			</tr>
		</table>

	</form>
</body>
</html>